#include <stdio.h>

int main( ) {
	char s[20];
	int i = 0, a = 1;
	gets (s);
	while (s[i] != '\0' ) {
		if ((s[i] >= 'A' && s[i] <= 'Z' ) || (s[i] >= 'a' && s[i] <= 'z' ) || (s[i] >= '0' && s[i] <= '9' )) {
			printf ( "%c", s[i]);
			a = 1;
		} else if (a == 1) {
			printf ( "\n" );
			a = 0;
		}
		i++;
	}
	return 0;
}

